unit untPrincipal;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Menus, AppEvnts, ComCtrls, ExtCtrls, Buttons, XPMan, ActnList;

type
  TfrmMenu = class(TForm)
    mm1: TMainMenu;
    Cadasdtro1: TMenuItem;
    Cliente1: TMenuItem;
    Fornecedor1: TMenuItem;
    Marca1: TMenuItem;
    Produto1: TMenuItem;
    Usurio1: TMenuItem;
    pnl1: TPanel;
    statusbar: TStatusBar;
    btn1: TSpeedButton;
    btn2: TSpeedButton;
    btn3: TSpeedButton;
    btn4: TSpeedButton;
    btn5: TSpeedButton;
    XPManifest1: TXPManifest;
    tmr1: TTimer;
    procedure Cliente1Click(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure Marca1Click(Sender: TObject);
    procedure Fornecedor1Click(Sender: TObject);
    procedure Usurio1Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure tmr1Timer(Sender: TObject);

  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmMenu: TfrmMenu;

implementation

uses untListagemCliente, untDM, untListagemMarca, untListagemFornecedor,
  untListagemUsuario;

{$R *.dfm}

procedure TfrmMenu.Cliente1Click(Sender: TObject);
begin
  Application.CreateForm(TfrmListagemCliente, frmListagemCliente);
  frmListagemCliente.ShowModal;
end;

procedure TfrmMenu.Fornecedor1Click(Sender: TObject);
begin
  Application.CreateForm(TfrmListagemFornecedor, frmListagemFornecedor);
  frmListagemFornecedor.ShowModal;
end;

procedure TfrmMenu.Marca1Click(Sender: TObject);
begin
  Application.CreateForm(TfrmListagemMarca, frmListagemMarca);
  frmListagemMarca.ShowModal;
end;

procedure TfrmMenu.Usurio1Click(Sender: TObject);
begin
  Application.CreateForm(TfrmListagemUsuario, frmListagemUsuario);
  frmListagemUsuario.ShowModal;
end;

procedure TfrmMenu.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  if MessageDlg('Deseja mesmo sair do sistema?', mtConfirmation, [mbYes,mbNo], 0) = mrYes then
     Action := caFree
  else
     Action := caNone;

end;

procedure TfrmMenu.FormShow(Sender: TObject);
begin
  statusbar.Panels[0].Text := '' +  FormatDateTime('hh:nn:ss',now);
  statusbar.Panels[1].Text := '' + FormatDateTime(' dddd", "dd" de "mmmm" de "yyyy',now);
end;

procedure TfrmMenu.tmr1Timer(Sender: TObject);
begin
  statusbar.Panels[0].Text := '' +  FormatDateTime('hh:nn:ss',now);
  statusbar.Panels[1].Text := '' + FormatDateTime(' dddd", "dd" de "mmmm" de "yyyy',now);
end;

end.
